package com.finance.action.android.customer;

import java.util.Date;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.common.vo.JsonVo;
import com.finance.entity.customer.TaobaoConsumption;
import com.finance.service.customer.TaobaoConsumptionService;

@Controller("TaobaoConsumptionAction")
public class TaobaoConsumptionAction {

	@Resource(name = "TaobaoConsumptionService")
	private TaobaoConsumptionService taobaoConsumptionService;
	
	/**
	 * 添加淘宝消费记录
	 * @param kfUserId 客户id
	 * @param orderId 订单id
	 * @param orderTime 订单时间
	 * @param orderAmt 订单金额
	 * @param orderStatus 订单状态
	 * @param items 商品名
	 * @param itemQuantity 商品数量
	 * @param receivePersonName 收货人
	 * @param receivePersonMobile 收货人电话
	 * @param receiveAddress 收货地址
	 * @return
	 */
	@ResponseBody
	@RequestMapping("addtaoBao")
	public JsonVo<String> addtaoBao(String kfUserId, String orderId,
			Date orderTime, Long orderAmt, String orderStatus, String items,
			Integer itemQuantity, String receivePersonName,
			String receivePersonMobile, String receiveAddress) {
		JsonVo<String> json = new JsonVo<String>();
		TaobaoConsumption taobaoConsumption = new TaobaoConsumption();
		taobaoConsumption.setKfUserId(kfUserId);
		taobaoConsumption.setOrderId(orderId);
		taobaoConsumption.setOrderTime(orderTime);
		taobaoConsumption.setOrderAmt(orderAmt);
		taobaoConsumption.setOrderStatus(orderStatus);
		taobaoConsumption.setItems(items);
		taobaoConsumption.setItemQuantity(itemQuantity);
		taobaoConsumption.setReceivePersonName(receivePersonName);
		taobaoConsumption.setReceivePersonMobile(receivePersonMobile);
		taobaoConsumption.setReceiveAddress(receiveAddress);
		taobaoConsumptionService.insert(taobaoConsumption);
		json.setCode(200);
		json.setMsg("成功");
		json.setSuccess(true);
		return json;
	}
	
	
	

}
